#ifndef TimeUtil_H__
#define TimeUtil_H__
#include "cmsis_os.h"

typedef TickType_t TimeType;

float GetSysTimestamp(void);

static __inline TimeType GetSysMs() {
    return osKernelSysTick();
}

static __inline void WaitMs(TimeType ms) {
    TimeType timeout = GetSysMs() + ms;
    while (GetSysMs() < timeout);
}

#endif
